package com.atguigu.gmall.cart.client;

import com.atguigu.gmall.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

/**
 * 调用 servicep-cart服务
 */
@FeignClient(name = "service-cart")
public interface CartFeignClient {


    //加入购物车
    @RequestMapping("/api/cart/addCart/{skuId}/{skuNum}")
    public Result addCart(@PathVariable(name = "skuId") Long skuId,
                          @PathVariable(name = "skuNum") Integer skuNum);


    //3:根据用户ID
    // 查询购物车中已经选中的商品  设置给订单详情对象 准备出订单详情对象的集合 并回显页面
    //       order_detail  集合
    //4:商品总件数
    //5:商品总金额
    @GetMapping("/api/cart/getCartCheckedList/{userId}")
    public Result<Map<String,Object>> getCartCheckedList(@PathVariable(name = "userId") Long userId);
}
